//
//  SimpleWebImageManager.h
//  SimpleWebImage
//
//  Created by Jiang on 2019/8/26.
//  Copyright © 2019 SilverFruity. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "SimpleDiskCache.h"
#import "SimpleMemoryCache.h"
#import "SimpleImageOperation.h"

NS_ASSUME_NONNULL_BEGIN


@interface SimpleWebImageManager: NSObject
+ (instancetype)shareInstance;
@property (nonatomic,strong)SimpleImageOperationPool *operationPool;
@property (nonatomic,strong)id <SimpleCacheProtocol> memoryCache;
@property (nonatomic,strong)id <SimpleCacheProtocol> diskCache;

- (SimpleImageOperation *)loadImageWithUrl:(nullable NSURL *)url
                                  progress:(nullable void (^)(double progress, NSURL *url))progress
                                  complete:(nullable void (^)(UIImage *image,NSURL *url, NSError * _Nullable error))complete;

- (NSString *)cacheKeyForUrl:(NSURL *)url;
@end


NS_ASSUME_NONNULL_END
